package com.java83.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.java83.dao.TraineeDao;
import com.java83.dto.impl.OneDto;
import com.java83.entity.Trainee;
import com.java83.service.TraineeService;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author: ljy
 * @date: 2021/12/14 12:23
 * @decription:
 */
@Service
public class TraineeServiceImpl implements TraineeService {


    @Resource
    TraineeDao traineeDao;

    @Override
    public PageInfo<Trainee> selectAll(OneDto<Trainee> oneDto) {

        PageHelper.startPage(oneDto.getPage(),oneDto.getLimit());

        Trainee trainee = oneDto.getData();
        List<Trainee> trainees = traineeDao.queryAllByLimit(trainee);
        return new PageInfo<>(trainees);
    }
}
